<?php

namespace addons\oil\listener\order;

use addons\oil\exception\Exception;
use addons\sum\model\Config;
use addons\sum\model\User;
use think\Db;

/**
 * 订单退款
 */
class Refund
{
    // 订单同意退款前
    public function orderRefundBefore(&$params)
    {
        $order = $params['order'];
        $item = $params['item'];

    }


    // 订单同意退款后
    public function orderRefundAfter(&$params)
    {
        $order = $params['order'];

        //返回用户
//        // 订单退款成功
//        $user = User::where('id', $order['user_id'])->find();
//        $user && $user->notify(
//            new \addons\sum\notifications\Refund([
//                'order' => $order,
//                'event' => 'refund_agree'
//            ])
//        );
    }
}
